package cn.bdqn.controller.Role;

import cn.bdqn.pojo.Role.SysUserRole;
import cn.bdqn.service.Role.RoleService;
import cn.bdqn.service.Role.User_RoleService;
import cn.bdqn.utils.Json;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/role")
public class RoleController {
    @Autowired
    RoleService service;
    @Autowired
    User_RoleService userRoleService;
    Json json=null;
    @PostMapping("/insertUserAndRole")
    public Json insertUserAndRole(@RequestBody SysUserRole userRole){
        Integer integer = service.insertUserAndRole(userRole);
        json=new Json();
        if(integer>=0){
            json.setCode(200);
        }else{
            json.setCode(400);
        }
        return json;
    }


}
